<?php /* Smarty version 2.6.18, created on 2010-03-11 09:56:29
         compiled from dataFMA_popup.tpl */ ?>
<div id="main_content">
<div id="blanket" style="display:none;"></div>
<div id="organization_details" width="100%">
	<h2 class="dotted">Organization Details</h2>
	<input type="hidden" name="org_id" value="<?php echo $this->_tpl_vars['org_id']; ?>
">
	<table width="100%">
		<tr valign="top">
			<td width="35%">
				<form name="mainForm" method="POST" id="mainForm" action="/admin/dataFMASaveOrg">
				<input type="hidden" name="org_id" value="<?php echo $this->_tpl_vars['org_id']; ?>
">
				<table border="0" width="100%" class="grid">
					<tr>
						<td class="notify" width="50%"><label>Name:</label></td>
						<td><input type="text" name="name" value="<?php echo $this->_tpl_vars['organization'][0]['name']; ?>
"></td>
					</tr>
					<tr>
						<td class="notify"><label>Trading Name:</label></td>
						<td><input type="text" name="trading_name" value="<?php echo $this->_tpl_vars['organization'][0]['trading_name']; ?>
"></td>
					</tr>
					<tr>
						<td class="notify"><label>Phone:</label></td>
						<td><input type="text" name="phone" value="<?php echo $this->_tpl_vars['organization'][0]['phone']; ?>
"></td>
					</tr>
					<tr>
						<td class="notify"><label>Fax:</label></td>
						<td><input type="text" name="fax" value="<?php echo $this->_tpl_vars['organization'][0]['fax']; ?>
"></td>
					</tr>
					<tr>
						<td class="notify"><label>Email:</label></td>
						<td><input type="text" name="email" value="<?php echo $this->_tpl_vars['organization'][0]['email']; ?>
"></td>
					</tr>
					<tr>
						<td class="notify"><label>Website:</label></td>
						<td><input type="text" name="website" value="<?php echo $this->_tpl_vars['organization'][0]['website']; ?>
"></td>
					</tr>
					<tr>
						<td class="notify"><label>Inactive:</label></td>
						<td><input type="checkbox" value="1" name="inactive" <?php if ($this->_tpl_vars['organization'][0]['inactive'] == 1): ?>checked<?php endif; ?>></td>
					</tr>
					<tr>
						<td class="notify"><label>Non Taxable:</label></td>
						<td><input type="checkbox" value="1" name="non_taxable" <?php if ($this->_tpl_vars['organization'][0]['non_taxable'] == 1): ?>checked<?php endif; ?>></td>
					</tr>
					<tr>
						<td class="notify"><label>Organization Type:</label></td>
						<td>
							<select name="organization_type">
								<?php $_from = $this->_tpl_vars['organizationTypes']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['type']):
?>
									<option value="<?php echo $this->_tpl_vars['type']['org_type']; ?>
"
									<?php if ($this->_tpl_vars['type']['org_type'] == $this->_tpl_vars['organization'][0]['org_type']): ?>
										selected
									<?php endif; ?>
									>
									<?php echo $this->_tpl_vars['type']['org_type']; ?>
</option>
								<?php endforeach; endif; unset($_from); ?>
							</select>
						</td>
					</tr>
					<tr>
						<td class="notify"><label>Notes:</label></td>
						<td><input type="text" name="notes" value="<?php echo $this->_tpl_vars['organization'][0]['notes']; ?>
"></td>
					</tr>
					<tr>
						<td class="notify"><label>Credit Limit:</label></td>
						<td><input type="text" name="credit_limit" value="<?php echo $this->_tpl_vars['organization'][0]['credit_limit']; ?>
"></td>
					</tr>
					<tr>
						<td class="notify"><label>Ship Method:</label></td>
						<td>
							<select name="ship_method">
								<?php $_from = $this->_tpl_vars['ship_methods']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['ship_method']):
?>
									<option value="<?php echo $this->_tpl_vars['ship_method']['name']; ?>
"
									<?php if ($this->_tpl_vars['ship_method']['name'] == $this->_tpl_vars['organization'][0]['ship_method']): ?>
										selected
									<?php endif; ?>
									><?php echo $this->_tpl_vars['ship_method']['name']; ?>
</option>
								<?php endforeach; endif; unset($_from); ?>
							</select>
						</td>
					</tr>
					<tr>
						<td class="notify"><label>Tax Id Number:</label></td>
						<td><input type="text" name="tax_id_number" value="<?php echo $this->_tpl_vars['organization'][0]['tax_id_number']; ?>
"></td>
					</tr>
					<tr>
						<td class="notify"><label>Bank Name:</label></td>
						<td><input type="text" name="bank_name" value="<?php echo $this->_tpl_vars['organization'][0]['bank_name']; ?>
"></td>
					</tr>
					<tr>
						<td class="notify"><label>Bank Account Number:</label></td>
						<td><input type="text" name="bank_account_number" value="<?php echo $this->_tpl_vars['organization'][0]['bank_account_number']; ?>
"></td>
					</tr>
					<tr>
						<td class="notify"><label>Currency Mark:</label></td>
						<td>
							<select name="currency_mark">
								<?php $_from = $this->_tpl_vars['currencies']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['currency']):
?>
									<option value="<?php echo $this->_tpl_vars['currency']['name']; ?>
"
									<?php if ($this->_tpl_vars['currency']['name'] == $this->_tpl_vars['organization'][0]['currency_mark']): ?>
										selected
									<?php endif; ?>
									><?php echo $this->_tpl_vars['currency']['currency_mark']; ?>
</option>
								<?php endforeach; endif; unset($_from); ?>
							</select>
						</td>
					</tr>
				</table><br>
				<input type="submit" value="Save">				
				<input type="button" value="Cancel" onclick="doajaxAction('/admin/<?php echo $this->_tpl_vars['org_maintenance_type']; ?>
',0,'main_content');">								<input type="hidden" name="org_maintenance_type" value="<?php echo $this->_tpl_vars['org_maintenance_type']; ?>
">
				</form>
			</td>
			<td>
				<div <?php if ($this->_tpl_vars['org_id'] == 0): ?>style="display:none"<?php endif; ?>>
				<h2 class="dotted">Organization Addresses</h2>
				<form name="aForm" method="POST" id="aForm" action="/admin/dataFMASaveAListChanges">
				<input type="hidden" name="org_id" value="<?php echo $this->_tpl_vars['org_id']; ?>
">
				<div id="pageNavPositionOA" style="color:#84b5cc" width="100%"></div>
				<table width="100%" class="grid" id="resultsOA">
					<tr bgcolor="#cccccc">
						<td width="5%"></td>
						<td width="5%"><label><b>Primary</b></label></td>
						<td align="center" width="5%"><label><b>Delete</b></label></td>
						<td><label><b>Street</b></label></td>
						<td><label><b>City</b></label></td>
						<td><label><b>Province</b></label></td>
						<td><label><b>Country</b></label></td>
					</tr>
					<?php $_from = $this->_tpl_vars['org_addresses']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['org_address']):
?>
						<tr>
							<td align="center">
								<input type="button" value="Edit" onclick="edit_aitem(<?php echo $this->_tpl_vars['org_address']['org_address_id']; ?>
,<?php echo $this->_tpl_vars['org_id']; ?>
,<?php echo $this->_tpl_vars['org_address']['address_id']; ?>
);">
							</td>
							<td align="center">
								<input type="radio" name="primary_address" value="<?php echo $this->_tpl_vars['org_address']['address_id']; ?>
"
									<?php if ($this->_tpl_vars['org_address']['address_id'] == $this->_tpl_vars['organization'][0]['primary_address_id']): ?> checked <?php endif; ?>
								>
							</td>
							<td align="center"><input type="checkbox" value="1" name="del_<?php echo $this->_tpl_vars['org_address']['org_address_id']; ?>
"</td>
							<td><label><?php echo $this->_tpl_vars['org_address']['address1']; ?>
</label></td>
							<td><label><?php echo $this->_tpl_vars['org_address']['city']; ?>
</label></td>
							<td><label><?php echo $this->_tpl_vars['org_address']['province']; ?>
</label></td>
							<td><label><?php echo $this->_tpl_vars['org_address']['country_code']; ?>
</label></td>
						</tr>
					<?php endforeach; endif; unset($_from); ?>
				</table>
				<br>
				<input type="button" value="Add" onclick="edit_aitem(0,<?php echo $this->_tpl_vars['org_id']; ?>
,0);">
				<input type="submit" value="Save Changes">
				</form>
				
				<br><br>
				<h2 class="dotted">Organization Contacts</h2>
				<form name="cForm" method="POST" id="cForm" action="/admin/dataFMASaveCListChanges">
				<input type="hidden" name="org_id" value="<?php echo $this->_tpl_vars['org_id']; ?>
">
				<div id="pageNavPositionOC" style="color:#84b5cc" width="100%"></div>
				<table width="100%" class="grid" id="resultsOC">
					<tr bgcolor="#cccccc">
						<td width="5%"></td>
						<td width="5%"><label><b>Primary</b></label></td>
						<td align="center" width="5%"><label><b>Delete</b></label></td>
						<td><label><b>Contact Name</b></label></td>
						<td><label><b>Remarks</b></label></td>
						<td><label><b>Phone</b></label></td>
						<td><label><b>Email</b></label></td>
					</tr>
					<?php $_from = $this->_tpl_vars['org_contacts']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['org_contact']):
?>
						<tr>
							<td align="center">
								<input type="button" value="Edit" onclick="edit_citem(<?php echo $this->_tpl_vars['org_contact']['org_contact_id']; ?>
,<?php echo $this->_tpl_vars['org_id']; ?>
,<?php echo $this->_tpl_vars['org_contact']['contact_id']; ?>
);"
							</td>
							<td align="center">
								<input type="radio" name="primary_contact" value="<?php echo $this->_tpl_vars['org_contact']['contact_id']; ?>
"
										<?php if ($this->_tpl_vars['org_contact']['contact_id'] == $this->_tpl_vars['organization'][0]['primary_contact_id']): ?> checked <?php endif; ?>
									>
							</td>
							<td align="center"><input type="checkbox" value="1" name="del_<?php echo $this->_tpl_vars['org_contact']['org_contact_id']; ?>
"></td>
							<td><label><?php echo $this->_tpl_vars['org_contact']['name']; ?>
</label></td>
							<td><label><?php echo $this->_tpl_vars['org_contact']['remarks']; ?>
</label></td>
							<td><label><?php echo $this->_tpl_vars['org_contact']['telephone_no']; ?>
</label></td>
							<td><label><?php echo $this->_tpl_vars['org_contact']['email']; ?>
</label></td>
						</tr>
					<?php endforeach; endif; unset($_from); ?>						
				</table>
				<br>
				<input type="button" value="Add" onclick="edit_citem(0,<?php echo $this->_tpl_vars['org_id']; ?>
,0);">
				<input type="submit" value="Save Changes">
				</form>
				<br><br>																<h2 class="dotted">Fishing Areas</h2>				<form name="faForm" method="POST" id="faForm" action="/admin/dataFMASaveFAListChanges">				<input type="hidden" name="org_id" value="<?php echo $this->_tpl_vars['org_id']; ?>
">				<div id="pageNavPositionOC" style="color:#84b5cc" width="100%"></div>				<table width="100%" class="grid" id="resultsFA">					<tr bgcolor="#cccccc">						<td width="5%"></td>						<td align="center" width="5%"><label><b>Delete</b></label></td>						<td><label><b>Name</b></label></td>						<td><label><b>Area</b></label></td>						<td><label><b>Country</b></label></td>					</tr>					<?php $_from = $this->_tpl_vars['fishing_areas']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['fishing_area']):
?>						<tr>							<td align="center">								<input type="button" value="Edit" onclick="edit_faitem(<?php echo $this->_tpl_vars['fishing_area']['fishing_area_id']; ?>
,<?php echo $this->_tpl_vars['org_id']; ?>
);"							</td>							<td align="center"><input type="checkbox" value="1" name="del_<?php echo $this->_tpl_vars['fishing_area']['fishing_area_id']; ?>
"></td>							<td><label><?php echo $this->_tpl_vars['fishing_area']['fishing_area_name']; ?>
</label></td>							<td><label><?php echo $this->_tpl_vars['fishing_area']['area']; ?>
</label></td>							<td><label><?php echo $this->_tpl_vars['fishing_area']['country_code']; ?>
</label></td>						</tr>					<?php endforeach; endif; unset($_from); ?>										</table>				<br>				<input type="button" value="Add" onclick="edit_faitem(0,<?php echo $this->_tpl_vars['org_id']; ?>
);">				<input type="submit" value="Save Changes">				</form>								
				<br><br>
				<h2 class="dotted">Fishers</h2>
				<form name="fForm" method="POST" id="fForm" action="/admin/dataFMASaveFListChanges">
				<input type="hidden" name="org_id" value="<?php echo $this->_tpl_vars['org_id']; ?>
">
				<div id="pageNavPositionF" style="color:#84b5cc" width="100%"></div>
				<table width="100%" class="grid" id="resultsF">
					<tr bgcolor="#cccccc">
						<td width="5%"></td>
						<td width="5%"></td>												<td width="11%"><label><b>Fisher Code</b></label></td>						
						<td><label><b>Name</b></label></td>						
						<td><label><b>Fishing Area</b></label></td>
					</tr>
					<?php $_from = $this->_tpl_vars['fishers']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['fisher']):
?>
						<tr>
							<td align="center">
								<input type="button" value="Edit" onclick="edit_fitem(<?php echo $this->_tpl_vars['org_id']; ?>
,'<?php echo $this->_tpl_vars['fisher']['fisher_id']; ?>
');"
							</td>
							<td align="center"><input type="checkbox" value="1" name="del_<?php echo $this->_tpl_vars['fisher']['fisher_id']; ?>
"></td>							<td align="center"><?php echo $this->_tpl_vars['fisher']['fisher_code_number']; ?>
</td>							
							<td>
								<div align="center">
									<?php if ($this->_tpl_vars['fisher']['link'] != null): ?>
									<img  onclick="PopEx(this, null, null, null, 300, 50, 'PopBoxImageLarge');" 
									  pbCaption="<?php echo $this->_tpl_vars['fisher']['last_name']; ?>
,<?php echo $this->_tpl_vars['fisher']['first_name']; ?>
" 
									  id="trade<?php echo $this->_tpl_vars['key']; ?>
" width="98" 
									  src="<?php echo $this->_tpl_vars['fisher']['link']; ?>
" 
									  pbsrc="<?php echo $this->_tpl_vars['fisher']['link']; ?>
" 
									  class="PopBoxImageSmall" title="Click to magnify/shrink">
									<?php endif; ?>
									<br>
									<label><?php echo $this->_tpl_vars['fisher']['first_name']; ?>
 <?php echo $this->_tpl_vars['fisher']['last_name']; ?>
</label>
								</div>
							</td>
							<td><?php echo $this->_tpl_vars['fisher']['fishing_area_name']; ?>
</td>
						</tr>
					<?php endforeach; endif; unset($_from); ?>	
				</table>
				<br>
				<input type="button" value="Add" onclick="edit_fitem(<?php echo $this->_tpl_vars['org_id']; ?>
,'');">
				<input type="submit" value="Save Changes">
				</div>
			</td>
		</tr>
	</table>
</div>
</form>
<div id="popUpDiv" style="position:absolute;display:none;z-index:1002;">
	<table class="popup" border="0" cellspacing=0 cellpadding=0>
		<tr>
			<td>
				<div class="pop">
					<div class="top_pop"><img src="/app/default/www/images/top_left_pop.jpg" /></div> 
					<div id="edit_content" class="content">
					</div>
					<div class="btm_pop"><img src="/app/default/www/images/btm_left_pop.jpg"  alt="" /></div>
				</div>
			</td>
		</tr>
	</table> 
</div>
</div>
<?php echo '
<script language="javascript">
	ekimo_drag_region("","popUpDiv");
	
	function edit_aitem(org_address_id,org_id,address_id){		doajaxAction(\'/admin/dataFMAEditOrgAddress/id/\'+org_address_id+							\'/org_id/\'+org_id+\'/address_id/\'+address_id,0,\'edit_content\');
		popup(\'popUpDiv\');
	}
	function edit_citem(org_contact_id,org_id,contact_id){
		doajaxAction(\'/admin/dataFMAEditOrgContact/id/\'+org_contact_id+
					 \'/org_id/\'+org_id+\'/contact_id/\'+contact_id,0,\'edit_content\');
		popup(\'popUpDiv\');
	}
	function edit_fitem(org_id,id){
		doajaxAction(\'/admin/dataFMAEditFisher/id/\'+id+
					 \'/org_id/\'+org_id,0,\'edit_content\');
		popup(\'popUpDiv\');
	}		function edit_faitem(area_id,org_id){				doajaxAction(\'/admin/dataFMAEditFishingArea/area_id/\'+area_id+					 \'/org_id/\'+org_id,0,\'edit_content\');		popup(\'popUpDiv\');			}
	
	var pager = new Pager(\'resultsOA\', 10); 
	pager.init(); 
	pager.showPageNav(\'pager\', \'pageNavPositionOA\');
	pager.showPage(1);
	
	var pager = new Pager(\'resultsOC\', 10); 
	pager.init(); 
	pager.showPageNav(\'pager\', \'pageNavPositionOC\');
	pager.showPage(1);
	
	var pager = new Pager(\'resultsF\', 10); 
	pager.init(); 
	pager.showPageNav(\'pager\', \'pageNavPositionF\');
	pager.showPage(1);
</script>
'; ?>
